import request from '@/api/myRequest'

// 账号密码登录API
export function loginApi(data) {
  return request({
    url: `/service/member/login`,
    method: 'POST',
    data
  })
}

// 获取验证码API
export function getCodeNum(data) {
  return request({
    url: `/service/msm/login/${data}`,
    method: 'GET'
  })
}

// 手机号码登录API
export function phoneLoginApi(mobile, code) {
  return request({
    url: `/service/member/mobile/login?mobile=${mobile}&code=${code}`,
    method: 'POST'
  })
}

// 获取忘记密码验证码API
export function getForgetCodeAPI(data) {
  return request({
    url: `/service/msm/setPassword/${data}`,
    method: 'GET'
  })
}

// 登录忘记密码API
export function forgetPasswordApi(params) {
  return request({
    url: `/service/user/setPassword`,
    method: 'POST',
    params
  })
}

// 获取用户菜单API
export function getMenuApi() {
  return request({
    url: `/service/admin/permission/getMenu`,
    method: 'GET'
  })
}

// 获取用户信息API
export function getMemberInfoApi() {
  return request({
    url: `/service/member/getMemberInfo`,
    method: 'GET'
  })
}

export default { loginApi, getCodeNum, phoneLoginApi, forgetPasswordApi, getMenuApi, getMemberInfoApi }
